//
//  RootViewController.m
//  TestReactNativeProject
//
//  Created by guopengwen on 16/7/20.
//  Copyright © 2016年 Facebook. All rights reserved.
//

#import "RootViewController.h"
#import "RCTBundleURLProvider.h"
#import "RCTRootView.h"
#import "RCTBridge.h"

@interface RootViewController ()<RCTBridgeDelegate>

@end

@implementation RootViewController

- (void)loadView
{
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil];
  
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"TestReactNativeProject" initialProperties:nil];
  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  self.view = rootView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
   self.navigationController.navigationBar.hidden = YES;
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
  NSURL *sourceURL = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  
  sourceURL = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
  
  //sourceURL = [NSURL URLWithString:@"http://172.18.18.84:8081/index.ios.bundle?platform=ios&dev=true"];
  
  return sourceURL;
}


@end
